<?php
/**
 * @version     1.0.0
 * @package     com_student
 * @copyright   Copyright (C) 2011. All rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 * @author      duongca <duongca@ymail.com> - http://www.ohisee.co.cc
 */

// no direct access
defined('_JEXEC') or die;

//Load admin language file
$lang = JFactory::getLanguage();
$lang->load('com_student', JPATH_ADMINISTRATOR);
?>

<?php if( $this->item ) : ?>

    <div class="item_fields">
        
        <ul class="fields_list">

			<li><?php echo JText::_('COM_STUDENT_FORM_LBL_CLAZZ_ID'); ?>:
			<?php echo $this->item->id; ?></li>
			<li><?php echo JText::_('COM_STUDENT_FORM_LBL_CLAZZ_CLASS_NAME'); ?>:
			<?php echo $this->item->class_name; ?></li>
        </ul>
		<hr/>
		<h2>Student List</h2>
		<?php if(empty($this->item->students)){?>
			There are no student in this class
		<?php } else {?>
		<table width="100%">
		<tr>
		<th>ID</th>
		<th>Student Name</th>
		</tr>
		<?php foreach($this->item->students as $student): ?>
			<tr>
			<td style="border-right:solid 1px #888888; text-align:center;"><?php echo $student->value;?></td>
			<td style="padding-left:15px;"><a href="<?php echo JRoute::_('index.php?option=com_student&view=students&id=' . (int)$student->value); ?>"><?php echo $student->text; ?></a></td>
			</tr>
		<?php endforeach;?>
		</table>
		<?php }?>
        
    </div>
    
<?php else: ?>
    Could not load the item
<?php endif; ?>
